package playgame;

import java.awt.image.BufferedImage;

/**
 * MovingGameObject extends GameObject.
 * 
 * Makes it possible to set coordinates, and move GameObjects.
 * Handles GameObjects that can move around in the frame.
 * 
 * @author Bomberman Crew 20(C)09
 *
 */
public class MovingGameObject extends GameObject {
	
	// Co-ordinates
	int x;
	int y;
	
	// Moving! Yes / No
	int dx;
	int dy;
	
	/**
	 * Takes no parameter and constructs a MoveableObject with (0,0).
	 */
	public MovingGameObject(BufferedImage image) {
		super(image);
		x = 0;
		y = 0;
		dx = 0;
		dy = 0;
	}
	
	
	public int getX() {
		return x;
	}
	
	public int getY(){
		return y;
	}
	
	public int getDX(){
		return dx;
	}
	
	public int getDY(){
		return dy;
	}
	
	/**
	 * Flytter et GameObject en gitt lengde fra dens tidligere plass
	 * @param dx - hvor langt i x-retning man vil flytte objektet
	 * @param dy - hvor langt i y-retning man vil flytte objektet
	 *
	 */
	public void move(int dx, int dy){
		x += dx;
		y += dy;
	}
	
	public void setSpeed(int dx, int dy){
		this.dx = dx;
		this.dy = dy;
	}
	
	public void setX(int x){
		this.x = x;
	}
	
	public void setY(int y){
		this.y = y;
	}

	
}
